Imports System.Web
Imports System.Text.RegularExpressions
Public Class IWebVersion
    Public Shared Function GetVersion() As IWebVersion_Info

        Using IWeb As IWeb.WebCoreServiceClient = My.Forms.IWeb_Form.Factory.GetProxy(Of IWeb.WebCoreServiceClient)(CoreEndPoints.CoreService)

            Dim IWebVersion_Info As New IWebVersion_Info()

            IWebVersion_Info.VersionName = IWeb.GetVersion(IWebAuthentication.AttachCredentials)


            IWebVersion_Info.VersionNumber = CInt(Regex.Replace(IWebVersion_Info.VersionName, "\D", ""))

            Return IWebVersion_Info

        End Using

    End Function
    Public Shared Function CheckVersion(ByVal VersionToCheck As Integer) As Boolean

        Using IWeb As IWeb.WebCoreServiceClient = My.Forms.IWeb_Form.Factory.GetProxy(Of IWeb.WebCoreServiceClient)(CoreEndPoints.CoreService)

            Dim boolReturnValue As Boolean = False
            Try
                If (VersionToCheck > CInt(Regex.Replace _
                        (IWeb.GetVersion(IWebAuthentication.AttachCredentials), "\D", ""))) Then

                    boolReturnValue = False

                Else

                    boolReturnValue = True

                End If
            Catch ex As Exception
                boolReturnValue = False
            End Try

            Return boolReturnValue

        End Using

    End Function
End Class
